package com.ljx.qqpro.common.utils;

import com.ljx.qqpro.entity.UserEntity;

/**
 * 用于存储用户线程
 */

public class UserHolder {

    private static final ThreadLocal<UserEntity> tl = new ThreadLocal<>();

    public static void saveUser(UserEntity user){
        tl.set(user);
    }

    public static UserEntity getUser(){
        return tl.get();
    }

    public static void removeUser(){
        tl.remove();
    }

}
